perm filename MEBUG.PUB[2,TES] blob sn#022538 filedate 1973-01-26 generic text, type T, neo UTF8
.<< PUB DECLARATIONS >>

.<< THESE ARE LEFT ON/OFF OVER THE WHOLE MANUSCRIPT FOR CONVIENCE! >>
.TURN ON "{∪#"
.TURN OFF "-" << Too many minus signs would be mistaken for hyphens. >>

.MACRO STANDARD FRONT(SECPRINT, SSPRINT, PAGEPRINT, INDEXCHAR) ⊂
.IF "SECPRINT" ≠ NULL THEN
.	START
.	COUNT SECTION PRINTING "SECPRINT"
.	MACRO SEC(NAME,ABBREV,PHRASE,LABEL) ⊂ SECNAME ← MYNAME; SSNAME ← NULL ;
.	SKIP TO COLUMN 1; LABEL  NEXT SECTION;
.		BEGIN
.		CENTER
SECTION {!}
.		SKIP
NAME
.		SKIP 3
.		SECNAME←IF "ABBREV" = NULL THEN "NAME" ELSE "ABBREV";
.		CAT("PHRASE","NAME");
.		SEND CONTENTS ⊂ SKIP 2;
∂4{SECTION!}∂8NAME\∞ ∞.∞ →#{PAGE!}{SKIP;⊃
.		END	⊃
.	END ;
.IF "SSPRINT" ≠ NULL THEN
.	START
.	SUBBING ← "YES"
.	COUNT SUBSECTION IN SECTION PRINTING "SSPRINT"
.	MACRO SS(NAME,PHRASE,LABEL) ⊂
.		SSNAME←NULL; IF LINES≤7 THEN NEXT PAGE; LABEL  NEXT SUBSECTION;
.		BEGIN
.		SKIP 3
.		CAT("PHRASE","NAME");
.		SEND CONTENTS ⊂
∂(13){!}∂(19)NAME\∞ ∞.∞ →#{PAGE!}
. ⊃
.		CENTER
{!}##NAME{	SKIP; SSNAME←!&"##NAME";
.		END⊃
.	END
.ELSE SUBBING ← "NO"
.IF "PAGEPRINT" ≠ NULL THEN COUNT PAGE IN SECTION PRINTING "PAGEPRINT"
.INDEXING ← IF "INDEXCHAR"=NULL THEN "*" ELSE "INDEXCHAR" ;
.IF "INDEXCHAR" ≠ NULL THEN
.	START
.	MACRO CATALOG(PHRASE) ⊂SEND INDEX ⊂}<<{PAGE}#PHRASE#{⊃ ⊃
.	MACRO CAT(PHRASE,NAME) ⊂IF "PHRASE"≠NULL THEN
.		IF "PHRASE"="←" THEN CATALOG("NAME") ELSE CATALOG("PHRASE")⊃
.	AT INDEXING  PHRASE  INDEXING  ⊂
.		"PHRASE" ;
.		CATALOG("PHRASE")⊃
.	END
.ELSE INDEXING ← "NO"
.INSERT CONTENTS
.PORTION MAINPORTION
.SECNAME ← SSNAME ← NULL
.⊃

.MACRO STANDARD BACK ⊂
.SECNAME ← MYNAME; SSNAME ← NULL
.IF INDEXING ≠ "NO" THEN
.	BEGIN FILL NOJUST INDENT 0,3 PREFACE 0 TURN ON "←→∞\"
.	TABS 3,6,9,12,15,18,21,24,27,30,33,36
.	TITLE AREA INDEXHEAD LINES 4 TO 6
.	AREA TEXT LINES 7 TO 51 IN 2 COLUMNS 5 APART
.	PORTION INDEX
.	PLACE INDEXHEAD
←INDEX
.	PLACE TEXT
.	WASWORD ← WASLETT ← WASPG ← NULL ;
.	AT "<<" PGNO "#" PHRASE "#" ⊂ LETT ← "PHRASE"[1] ;
.		IF LETT ≠ WASLETT THEN IF LINES≥6 THEN SKIP 2
.			ELSE START SKIP TO LINE 51;SKIP;END;
.		IF "PHRASE" ≠ WASWORD THEN START BREAK }PHRASE\∞ ∞.∞ →#PGNO{ END
.		ELSE IF "PGNO" ≠ WASPG THEN },#PGNO{ ;
.		WASPG ← "PGNO" ; WASLETT ← LETT ; WASWORD ← "PHRASE" ; ⊃
.	SSNAME ← "INDEX"
.	RECEIVE "##"
.	END
.SSNAME←NULL
.COUNT PAGE PRINTING "i"
.PORTION CONTENTS
.FILL NOJUST CRBREAK TURN ON "←→∂\∞"
.INDENT 0,30,10 PREFACE 0 TABS 30,33,36,39,42,45,48,51,54,57,60,63
←T A B L E   O F   C O N T E N T S
.SKIP 3
.SSNAME←"TABLE OF CONTENTS"
SECTION→PAGE
.SKIP;
.RECEIVE
.⊃

.MACRO CENT (NAME,PHRASE) ⊂IF LINES ≤ 7 THEN SKIP TO COLUMN 1;;
.CAT("PHRASE","NAME");
.SEND CONTENTS ⊂
∂(23)NAME\∞ ∞.∞ →#{PAGE!}
.⊃
.BEGIN CENTER SKIP 3
NAME
.SKIP; END⊃


.MACRO UUO (NAME,OPCODE,OP2) ⊂
.SKIP 3
.BEGIN NOFILL GROUP;TABS 9;TURN ON "\";
%NAME%\{IF "OPCODE"="CALLI" THEN "[OP=047, ADR=OP2]  CALLI OP2"
.XTDUUO(TTYUUO,051,OPCODE,OP2)
.XTDUUO(PTYUUO,711,OPCODE,OP2)
.XTDUUO(PPIOT,702,OPCODE,OP2)
.XTDUUO(PGIOT,715,OPCODE,OP2)
.XTDUUO(INTUUO,723,OPCODE,OP2)
.XTDUUO(MAIL,710,OPCODE,OP2)
.ELSE "[OP=OPCODE]";
.TURN OFF;VERBATIM
------------------------------------------
.⊃

.MACRO XTDUUO(GROUPNAME,OPCODE,NAME,ACFIELD)⊂ELSE IF "NAME"="GROUPNAME" THEN
."[OP=OPCODE, AC=ACFIELD]  GROUPNAME ACFIELD,"⊃

.MACRO UUOX ⊂BEGIN SKIP 3; GROUP VERBATIM
------------------------------------------
.⊃

.MACRO UEND ⊂SKIP; IF LINES > 2 THEN APART; FILL⊃

.MACRO BEGVS ⊂BEGIN VERBATIM; SKIP⊃

.MACRO BEGV ⊂BEGIN VERBATIM;⊃

.MACRO BEGG ⊂BEGIN GROUP⊃

.MACRO VS ⊂VERBATIM SKIP⊃

.MACRO ENDC ⊂END;CONTINUE;⊃

.MACRO YON (LABEL) ⊂"page ";PAGE! LABEL⊃

.MACRO YONAPP (LABEL) ⊂"Appendix ";APPENDIX! LABEL⊃

.MACRO YONSEC (LABEL) ⊂"Section ";SECTION LABEL⊃

.MACRO YONSS (LABEL) ⊂"Section ";SUBSECTION! LABEL⊃

.MYNAME←"UUO Manual";
.MYDATE←DAY&" "&MONTH[1 TO 3]&" "&YEAR[3 TO 4];
.NBRXTDUUOS←"six" << the number of extended UUOs, which see in INTRODUCTION >>

.COUNT APPENDIX PRINTING "A"

.<< temporary initializations >>
.SECNAME←MYNAME
.SSNAME←NULL

.<< here are the labels yet undefined >>

.<< appendices >>
.PDP10STUFF:	99
.CALLIS:	99
.JOBDATA:	99

.<< sections >>
.TTYIO:		99
.DEVICE:   	99

.<< subsections >>
.PAPERTAPE:	"99.99"
.DISK:		"99.99"
.MAGTAPES:	"99.99"
.DECTAPES:	"99.99"
.IOSTATUSUUOS:	"99.99"
.USETUUOS:	"99.99"

.<< page numbers >>
.DATEUUO:	999
.<< TITLE PAGE >>

.BEGIN "TITLE"; NOFILL; TURN ON "→";
STANFORD ARTIFICIAL INTELLIGENCE LABORATORY→{MYDATE}
OPERATING NOTE 55.3
.SKIP 4;CENTER
STANFORD AI PROJECT MONITOR MANUAL
CHAPTER II
.SKIP 5
.(↑MYNAME)
.SKIP 3
by
.SKIP;
Martin Frost
.END "TITLE"

.BEGIN "ABSTRACT"; INDENT 5,5,5; SKIP 12
This document describes the UUOs (monitor call instructions) available
under the Stanford AI Project timesharing system.  Additional
general information relevant to the use of the UUOs is contained
in the introductory section, and some useful
tables are included in the appendices.

This manual replaces SAILON 55.2 by Andy Moorer (Monitor Manual,
Chapter II).  The index to SAILON
54.2 (Monitor Manual, Chapter I), which was contained in SAILON 55.2,
is now available separately as SAILON 54.21 (Index to Chapter I of the
Monitor Manual).
.END "ABSTRACT"

.STANDARD FRONT(1,!.1,,%)
.EVERY HEADING({SECNAME},{SSNAME},Page {PAGE})
.SEC INTRODUCTION

This manual assumes the reader has knowledge of the PDP-10
instruction format, data types and assembly languages.  The
aspects of these subjects that are relevant to this manual
are explained, however, in {YONAPP PDP10STUFF}.  The reader
who is new to the PDP-10 should read {YONAPP PDP10STUFF} before
tackling the meat of this manual.  The experienced user,
on the other hand, can skip the rest of the introductory
section.  Every reader's attention is called, nevertheless,
to {YONSS UNDERSTANDING} on "Understanding this Manual."

.SS UUOs,←
UUOs are monitor call instructions which make use of operation
codes that would otherwise be unused or illegal.  The
op codes from 000 to 077 are not used by any machine
instruction, and op codes from 700 to 777 are input/output
machine instructions, which are normally illegal in user
programs (except when in IOT-USER mode).  All
these op codes trap to the monitor, which can then take whatever
action it deems appropriate.  Taking advantage of this situation,
the system designates some of these Un-Used Operation codes (UUOs)
to be monitor calls for certain common functions (such as I/O).
Thus whenever a UUO is encountered
in the instruction stream, the monitor is called to execute the
function corresponding to the particular UUO.
Some of the op codes not defined by the system are available
to the user for defining his own special purpose UUOs.  The
method for defining these UUOs is explained in {YONSS USERUUOS}.
The categories of op codes that are used for UUOs are:
.BEGVS
	000	always illegal,
	001-037	user-definable UUOs,
	040-077	system-defined regular UUOs,
	700-777	system-defined IOT UUOs.
.END

The IOT UUOS are available only when the program is NOT in IOT-USER
mode; in IOT-USER mode these op codes are machine I/O instructions instead.

.SS Extended UUOs,←
In order to define more UUOs than there are op codes
available, two primary methods are employed to allow a single op code to
represent many different UUO functions.  The first of these methods
is to use the value of the accumulator (AC) field in the instruction
to specify one of 20 (octal) possible UUOs for a given op code.
Thus, for example, the OUTSTR UUO (which types out an ASCIZ string
on the console) is invoked by specifying the op code 051 and the
AC field 3.  There are currently {NBRXTDUUOS} op codes that use the value
of the AC field in this manner.  Each of these op codes has a
generic mneumonic which, together with a specific value for the
AC field, can be used to indicate a specific UUO.  In addition,
each combination of generic mneumonic and specific AC field has
a specific mneumonic which also can be used to indicate the UUO.
Op code 051 has the generic mneumonic TTYUUO, and TTYUUO with an
AC field of 3 has the specific mneumonic OUTSTR.
Thus the following two lines of code are equivalent.  (ADR is an
argument of this UUO; it specifies the address of the ASCIZ string
to be typed out.)
.BEGVS
	TTYUUO 3,ADR
	OUTSTR ADR
.END

Note, however, that not all of the mneumonics are known by all of the
assemblers (FAIL, MACRO, ...) or all of the debuggers (RAID, DDT, ...).
You can fool all of the assemblers some
of the time and some of the debuggers all of the time....

.SS CALLs and CALLIs,←
The second method of defining many UUOs with the same op code has
two versions.  In one of these, the address field of the UUO
points to a word which contains the SIXBIT name of the UUO function
desired.  In the other version, the address field of the UUO is itself
the number of the function desired.  The op code in the
first case is 040 and its mneumonic is CALL; the op code in the
second case is 047 and its mneumonic is CALLI (for CALL Immediate).
Exactly the same UUO functions are available through these two
methods.  Thus, the following two lines of code are equivalent; each
will cause execution of the EXIT UUO.
.BEGVS
	CALL  [SIXBIT /EXIT/]
	CALLI 12
.END

Inasmuch as there are these two versions of calling the same UUOs, the
following differences should be noted.

.BEGIN INDENT 6,9; PREFACE 0; SKIP
1.#If you use CALLs instead of CALLIs, you need remember only the
function names, which are somewhat descriptive and hence easy to
remember.  If you use CALLIs, you must remember the function numbers,
which are not at all descriptive!

2.#In using CALLs, an extra word is required in the program to store
the SIXBIT name of each function to be called.

3.#By using CALLs, you force the system to look up the function name
in a table in order to find out the function number.
.END

Difference 3 is the most significant of these.  It means that using CALLs
instead of CALLIs creates a substantial amount of extra work
that could be completely avoided.  Therefore, we ∪strongly urge
you to use CALLIs instead of CALLs, and to facilitate this use we
have included {YONAPP CALLIS} which contains two tables showing the
correspondences between function names and function numbers of CALLs and
CALLIs.  You need remember only the name of the CALL UUO
function you want and then find out its CALLI number from {YONAPP CALLIS}.
.STANDARD BACK